package com.example.demo.zabbix.request.builder.trigger;

import com.example.demo.zabbix.request.BaseRequest;
import com.example.demo.zabbix.request.builder.request.CreateRequestBuilder;

import java.util.Map;

/**
 * https://www.zabbix.com/documentation/4.0/manual/api/reference/triggerprototype/create
 */
public class TriggerPrototypeCreateRequestBuilder extends CreateRequestBuilder {
    private String description;
    private String expression;
    public TriggerPrototypeCreateRequestBuilder(String auth) {
        super("triggerprototype.create", auth);
    }

    public TriggerPrototypeCreateRequestBuilder(Long id, String auth) {
        super("triggerprototype.create", id, auth);
    }

    public String getDescription() {
        return description;
    }

    public TriggerPrototypeCreateRequestBuilder setDescription(String description) {
        this.description = description;
        return this;
    }

    public String getExpression() {
        return expression;
    }

    public TriggerPrototypeCreateRequestBuilder setExpression(String expression) {
        this.expression = expression;
        return this;
    }

    @Override
    public BaseRequest<Map<String, Object>> builder() {
        baseRequest.getParams().put("expression",expression);
        baseRequest.getParams().put("description",description);
        return baseRequest;
    }
}
